<?php

namespace app\common\model;


use think\Model;

class GuildManagerModel extends Model
{
    protected $connection = 'db_live';

    public function role()
    {
        return $this->hasOne(GuildRoleModel::class, 'id', 'role_id');
    }

    public function parent()
    {
        return $this->hasOne(self::class, 'id', 'parent_id')->field('id,real_name');
    }

    public function guild()
    {
        return $this->hasOne(GuildModel::class, 'id', 'guild_id');
    }
}